package chat;

import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;



public class ChatPane
extends JPanel
{
	private JLabel		m_statusLabel;


	public ChatPane()
	{
		super();

		MasterModel masterModel = new MasterModel();
		setLayout(new BorderLayout());
		JComponent tabbed = createTabbedPane(masterModel);
		this.add(tabbed, BorderLayout.CENTER);
		m_statusLabel = new JLabel();
		this.add(m_statusLabel, BorderLayout.SOUTH);

		setStatusLine(" ");
	}


	private JComponent createTabbedPane(MasterModel masterModel)
	{
		JTabbedPane tabbedPane = new JTabbedPane();
		JComponent	component;
		component = new ConnectionPanel(masterModel);
		tabbedPane.add(component, "Connection");

		component = new AudioPanel(masterModel);
		tabbedPane.add(component, "Audio");

		component = new SettingsPanel(masterModel);
		tabbedPane.add(component, "Settings");

		component = new InfoPanel(masterModel);
		tabbedPane.add(component, "Info");

		return tabbedPane;
	}


	public void setStatusLine(String strMessage)
	{
		m_statusLabel.setText(strMessage);
	}
}



/*** ChatPane.java ***/
